package com.isias.system.Service.Impl;

import com.isias.system.Service.IAuthenticationFacade;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

/**
 * 在security中获取当前用户信息具体实现类
 * 访问SecurityContextHolder获取
 */
@Service
public class AuthenticationFacade implements IAuthenticationFacade {
    @Override
    public Authentication getAuthentication() {
        return SecurityContextHolder.getContext().getAuthentication();
    }
}
